/**
 * Dear programmer:
 * When I wrote this code, only god and I knew how it worked.
 * Now, only god knows it!
 *
 * @author: lyl  Date: 2019-03-04 Time: 15:12
 *
 */
import {RequestAction, RequestMethod} from "../configuration/RequestConfiguration";
import {AppRequestPath} from "../configuration/AppConfig";
import {API_PROCEDURE2} from "../constant/API";
import global from "../configuration/global";
/**
 * 获取数据源
 * @param action
 * @param where 条件
 * @param table 条件
 * @param fileds 条件
 * @returns {*}
 */
export const procExecRetrieveJqGrid = (action, where,fileds,table) => {
    return RequestAction(
        AppRequestPath() + API_PROCEDURE2,
        RequestMethod.Post,
        {
            "hotelId": global.hotelId,
            "fu": "RetrieveJqGrid",
            "jn": {
                "where": where,
                "fileds": fileds,
                "table": {
                    "table": table
                },
                "wherestring": ["@@WS", ""]
            },
            "jnJson2": [{"page":0,"sord":"asc","rows":20,"sidx":"c_sort"}],
        },
        action
    )
};